package game;

import java.util.Objects;

public class Equipment {
    String name; // 物品名称
    String type; // 物品类型（武器或护甲）
    int attackBonus; // 攻击力加成
    int defenseBonus; // 防御力加成
    int hpBonus; // 生命值加成
    int intelligenceBonus; // 智力加成
    int staminaBonus; // 体力加成
    int dodgeBonus; // 闪避加成
    int price; // 价格

    // 更新的构造函数，包含新的参数
    public Equipment(String name, String type, int attackBonus, int defenseBonus, int hpBonus, int intelligenceBonus, int staminaBonus, int dodgeBonus, int price) {
        this.name = name;
        this.type = type;
        this.attackBonus = attackBonus;
        this.defenseBonus = defenseBonus;
        this.hpBonus = hpBonus;
        this.intelligenceBonus = intelligenceBonus;
        this.staminaBonus = staminaBonus;
        this.dodgeBonus = dodgeBonus;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public int getPrice() {
        return price;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        Equipment other = (Equipment) obj;
        return Objects.equals(name, other.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
}